#ifndef __SmileStore_h__
#define __SmileStore_h__
//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------
#include "SmileStruct.h"
//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------

class smileStore {

    private:

        char         *filename;

        smileStruct  *allSmiles;
        int           numberSmiles;

        double      **lingoSimilarity;
        double       *averageSimDistance;

    protected:

        int  splitPosLineIdCode(char*, int);
        int  orderListAncestor(long**&, int, int);
        void MixArray(long*, int);
        void MixArrayX(long*, int, long*, int, long*);
        void MergeSort(long*, int);
        
    public:

        //Constructor and Destructor
        smileStore();
        smileStore(char *);
        ~smileStore();

        //Input Functions
        void Filename(char*);
        void AllSmiles(const smileStruct *, int);
        void NumberSmiles(int);
        void LingoSimililarity(double **, int);
        void AverageSimDistance(double *, int);

        //Output Functions
        char*        Filename(void);
        int          AllSmiles(smileStruct*);
        int          NumberSmiles(void);
        int          LingoSimililarity(double**);
        int          AverageSimDistance(double*);
        smileStruct *OneSmileStruct(int);
        double       OneAverageSimDistance(int);

        //Operations Funtions
        int ExtractSmiles(void);
        int ExtractSmiles(char*);
        int ExtractSmiles(int, int);
        int ExtractSmiles(char*, int, int);

        void RandomFile(int);
        void OrderFile(char*, char*, int);
        void ReduceFile(char*, char*);

        int ObtainLingos(void);
        int ObtainLingos(char*);
        int ObtainLingos(const smileStruct *, int);

        int ObtainSimilarityMatrix(void);
        int ObtainSimilarityMatrix(char*);
        int ObtainSimilarityMatrix(const smileStruct *, int);

        int ObtainAverageSimDistance(void);
        int ObtainAverageSimDistance(char*);
        int ObtainAverageSimDistance(const smileStruct *, int);

        //Parallel Operations Funtions only with MPI options
        int ParallelObtainLingos(void);
        int ParallelObtainLingos(char*);
        int ParallelObtainLingos(const smileStruct *, int);

        int ParallelObtainSimilarityMatrix(void);
        int ParallelObtainSimilarityMatrix(char*);
        int ParallelObtainSimilarityMatrix(const smileStruct *, int);

        int ParallelObtainAverageSimDistance(void);
        int ParallelObtainAverageSimDistance(char*);
        int ParallelObtainAverageSimDistance(const smileStruct *, int);

};

#endif
//---------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------

